<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>修改量化</title>
<link href="../css/bootstrap-cerulean.css" rel="stylesheet">
<link href="../css/charisma-app.css" rel="stylesheet">
<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}
</style>
	<script src="http://lib.sinaapp.com/js/jquery/2.2.4/jquery-2.2.4.min.js"></script>
	<script src="../js/common/public.js"></script>
	<script src="../js/base64.js"></script>
	<script src="../js/bootstrap-modal.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
			var urlMsg = parseUrl(window.location.search);
			$("#token").val(urlMsg.token);
			if (urlMsg.token != null) {
				var token = decode(urlMsg.token);
				token=token.substring(0,token.length-1);
			}
			var html = $.ajax({
				type: "GET",
				url: "http://localhost:1068/admin/classScore/getClassScore?token="+token+"&id="+urlMsg.id,
				async: false
			}).responseText;
			var result = eval('(' + html + ')');
			if (result.code != 200) {
				alert(result.msg)
			} else {
				$("#classNumber").val(result.data.classNumber);
				$("#applyScore").val(result.data.applyScore);
				$("#finallyScore").val(result.data.finallyScore);
				$("#reason").val(result.data.reason);
				$("#page").val(result.data.page);
				$("#date").val(result.data.date);
			}
		});

		function updateScore() {
			var classNumber= $("#classNumber").val();
			var finallyScore = $("#finallyScore").val();
			var applyScore = $("#applyScore").val();
			var date = $("#date").val();
			var reason = $("#reason").val();
			var page = $("#page").val();
			var urlMsg = parseUrl(window.location.search);
			$("#token").val(urlMsg.token);
			if (urlMsg.token != null) {
				var token = decode(urlMsg.token);
				token=token.substring(0,token.length-1);
			}
			var html = $.ajax({
				type: "POST",
				url: "http://localhost:1068/admin/classScore/updateClassScore",
				data: {token: token, id: urlMsg.id,oldScore:urlMsg.oldScore, finallyScore: finallyScore,date: date,applyScore: applyScore,reason: reason,page:page,classNumber:classNumber},
				async: false
			}).responseText;
			var result = eval('(' + html + ')');
			if (result.code != 200) {
				alert(result.msg)
			} else {
				alert("修改成功！")
				window.location.href=document.referrer;
			}
		}
	</script>
</head>

<body>
	<div class="container-fluid"
		style="padding-left:0px;padding-right:2px;">
		<div class="row-fluid">
			<div id="content" class="span10" style="width:100%;">
				<div class="row-fluid sortable">
					<div class="box span12">
						<div class="box-header well">
							<h2>
								<i class="icon-edit"></i>修改量化信息
							</h2>
						</div>
						<div class="box-content" style="text-align:center">
							<form action="" method="post">

							<fieldset>
								<h1>修改量化信息</h1>
								<br><br>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px">班级代号：</span><input name="classnumber" value="" class="input" id="classNumber" readonly="readonly" type="text" style="height:30px;">
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px">申请操行：</span><input name="applyscore" value="" class="input" id="applyScore" type="text" style="height:30px;">
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px">批准操行：</span><input name="finallyscore" value="" class="input" id="finallyScore" type="text" style="height:30px;">
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px">申请时间：</span><input name="date" value="" class="input" id="date" type="text" style="height:30px;">
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px; padding-right:210px">申请原因：</span>
								</div>
								<br>
								<div class="controls">
								  <textarea name="reason" style="width:280px; height:150px;" id="reason" ></textarea>
								</div>
							  </div>
							  <div class="control-group">
								<div class="controls">
								  <span style="font-size:14px">操行页码：</span><input name="page" value="" class="input" id="page" type="text" style="height:30px;">
								</div>
							  </div>
							  
							  <div class="form-actions">
								<button type="button" onclick="updateScore()" class="btn btn-primary" style="width:100px;">提交</button>
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<button class="btn"  onclick="javascript:history.go(-1);" type="reset" style="width:100px;">取消</button>
							  </div>
							</fieldset>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
</html>